<template>
    <view class="report_content">
      <view class="report">
        <u-steps  activeColor="#ECB066" :current="workState" direction="column">
		  <u-steps-item class="report_step" iconSize="60">
		  	<view slot="desc" class="step_t">您的申请正在审核中</view>
		  	<view slot="desc"  class="step_tt">请静待客服联系您~</view>
		  </u-steps-item>
		  
		
		  
		  <u-steps-item class="report_step">
		  	<view slot="desc" class="desc">
				<view  v-if="checkState == 0 || checkState == 1">
					<view v-if="workOrderType == '2'" :class="workState > 0 ? 'step_t' : 'nostep_t'">您的检测正在处理中</view>
					<view v-if="workOrderType == '3'" :class="workState >0 ? 'step_t' : 'nostep_t'">您申请的服务正在处理中</view>
					<view v-if="workOrderType == '5'" :class="workState > 0 ? 'step_t' : 'nostep_t'">您的权益正在使用中</view>
				</view>
				<view v-if="checkState == 2">
					<view class="step_tno">经审核，您不符合权益的享受要求</view>
					<view v-if="workOrderType == '3'" class="step_tnoBtn" @click="resubmitUserImg">再次提交申请</view>
					<view v-if="workOrderType == '2'" class="step_tnoBtn" @click="resubmitPositiveImg">再次提交申请</view>
					<view v-if="workOrderType == '5'" class="step_tnoBtn" @click="resubmitUserIndex">再次提交申请</view>
				</view>
		  	</view>
		  </u-steps-item>


			<u-steps-item class="report_step">
				<view slot="desc" class="desc">
					<view v-if="workOrderType == '2' || workOrderType == '5' " :class="workState> 1 ? 'step_t' : 'nostep_t'">您的检测已完成！</view>
					 <view  v-if="workOrderType == '3'" :class="workState> 1 ? 'step_t' : 'nostep_t'">您的申请已完成！</view>
					<view class="step_three" v-if="workOrderType == '2' || workOrderType == '5'" @click="workState == 2 ? toShifeng() : ''">
					  <img class="three_img" src="https://oneredhealth.oss-cn-hangzhou.aliyuncs.com/2023/11/23/10b87203494b42d08749fcfa50c2b452.png" alt="">
					  <u-icon space="6rpx" :labelColor="workState > 1 ? '#FE9A1F' : '#999'" labelSize="34rpx" label="查看报告" labelPos="left" name="arrow-right" size="20" :color="workState > 1 ? '#FE9A1F' : '#999'" />
					</view>
				</view>
			</u-steps-item>
		
        </u-steps>
      </view>
    </view>
</template>

<script>
import { mapGetters } from "vuex"
import {
	baseUrl
} from "@/config/tendIdConfig.js";
export default {
  data() {
      return {
        checkState:'0',
        workState:'0',
		workOrderType:''
      };
  },
  onLoad(options) {
  	this.workOrderType = options.workOrderType
	this.equityInfoId= options.equityInfoId,
	this.cardNum= options.cardNum
	this.cardId= options.cardId
	this.getCardDetail()
  },
  computed: mapGetters(["userInfo"]),
  methods: {
    getCardDetail(){
		const token = this.$store.getters?.customer_token || uni.getStorageSync("customer_token")
		const that = this;
		uni.request({
		    url: baseUrl + '/customer/equityWorkOrderH5/web/selectEquityWorkOrder',
		    method: "POST",
			header: {
				Authorization: token
			},
		    data: {
				equityInfoId:that.equityInfoId,
				cardNum:that.cardNum
		    },
		    success(res) {
				console.log(res,'checkState》》》')
		        that.checkState = res.data.data.checkState
		        that.id = res.data.data.id
		        if(that.checkState == '1' || that.checkState == '2'){
		          that.workState = 1
		        }else{
		          that.workState= 0
		        }
				 that.getEquityInfoUncheckWhether()
		    },
		});
    },
    getEquityInfoUncheckWhether(){
		const token = this.$store.getters?.customer_token || uni.getStorageSync("customer_token")
		const that = this;
		uni.request({
		   url: baseUrl + '/customer/equityInfoH5/web/equityInfoUncheckWhether',
		    method: "POST",
			header: {
				Authorization: token
			},
		    data: {
				equityInfoId:that.equityInfoId,
				equityCardId:that.cardId,
		    },
		    success(res) {
		       if(res.data.data !== ''){
		         that.workState = 2
		       }
		       console.log(res,'是否勾选')
		    },
		});
    },
    resubmitUserImg(){
		this.$u.route({
			url: "/pages_card/resubmitUserImg/index",
			params: {
				equityInfoId:this.equityInfoId,
				cardNum:this.cardNum,
				id:this.id
			}
		})
    },
    resubmitPositiveImg(){
		this.$u.route({
			url: "/pages_card/resubmitPositiveImg/index",
			params: {
				equityInfoId:this.equityInfoId,
				cardNum:this.cardNum,
				id:this.id
			}
		})
    },
    resubmitUserIndex(){
      this.$router.push({ 
        path: "/resubmitUserIndex" ,
        query:{
            equityInfoId:this.$route.query.equityInfoId,
            cardNum:this.$route.query.cardNum,
            id:this.id
        }
      });
    },
    toShifeng() {
     uni.navigateTo({
         url: `/pages_my/health_records/index?customerPhone=${this.userInfo.mobile}`,
     });
    }
  }
};
</script>

<style scoped>
* {
    padding: 0;
    margin: 0;
}
.report_content {
  /* width: 100%; */
  height: 100%;
  box-sizing: border-box;
  background: #F6F7FB ;
  padding: 1.375rem .875rem;
  text-align: center;
}
.report{
  /* width: 100%; */
  /* height: 529px; */
  background: #fff;
  border-radius: .625rem;
  padding: .875rem;
}
.report_step{
  height:6.875rem ;
  padding:.75rem 0 0 1rem;
  text-align: left;
  font-size: 1.125rem;
  font-weight: 500;
}
.report_step_four{
  min-height:1.875rem ;
  max-height:5rem ;
}
.step_tnoBtn{
  width: 8.75rem;
  height: 2.5rem;
  border: .125rem solid #FC5E5E;
  border-radius: .75rem;
  font-size: 1rem;
  font-weight: 500;
  color: #FC5E5E;
  text-align: center;
  line-height: 2.5rem;
  margin-top: .625rem;
}
.step_three{
  margin-top: .75rem;
  width: 16.875rem;
  height: 4.9375rem;
  background: rgba(251,222,174,0.1);
  border-radius: .625rem;
  display: flex;
  align-items: center;
  justify-content: end;
  padding-left: 100rpx;
  font-size:1rem ;
  font-weight: 500;
}
.three_img{
  width: 3.5rem;
  height: 3.5rem;
  margin-right:2.875rem ;
}
.step_t{
  color: #333333;
  text-align: left;
}
.nostep_t{
  color: #999;
  text-align: left;
}
.step_tno{
  color: #FC5E5E;
  text-align: left;
}
.step_tt{
	height: 200rpx;
	text-align: left;
  margin-top: .375rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #FEA83B;
}
.desc{
		height: 200rpx;
		text-align: left;
	}

</style>
